#!/bin/bash
# Cleanup all services and clear GPU memory

echo "🧹 Cleaning up all services..."

# Stop vLLM
echo "  Stopping vLLM..."
pkill -f "vllm.entrypoints.openai.api_server" 2>/dev/null

# Stop Ollama
echo "  Stopping Ollama..."
systemctl stop ollama 2>/dev/null
pkill -f "ollama" 2>/dev/null

sleep 3

echo ""
echo "📊 GPU Status:"
nvidia-smi --query-gpu=index,name,memory.used,memory.total --format=csv,noheader,nounits

echo ""
echo "✅ Cleanup complete"

